<!-- 嵌套表单的弹出框 -->
<template>
  <div>
    <el-dialog
      :title="title"
      :visible.sync="open"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <slot></slot>

      <div slot="footer" class="dialog-footer">
        <el-button @click="cencle">关闭</el-button>
        <el-button type="primary" class="sure" @click="determine">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
    },
    show: {
      type: Boolean,
    },
    form: {
      type: Object,
    },
  },
  watch: {
    show: function (val) {
      this.shows = val
    },
  },
  computed: {
    open: function () {
      return this.shows
    },
  },

  data() {
    return {
      shows: false,
    }
  },
  methods: {
    cencle() {
      this.shows = false
      this.$emit('cencle')
    },
    determine() {
      this.shows = false
      this.$emit('determine')
    },
  },
}
</script>

<style></style>
